<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
    <title>AdminIndex</title>
    <link href="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/style.min.css" rel="stylesheet" />
    <link href="/css/styles.css" rel="stylesheet" />
    <link rel="icon" href="/assets/img/logo.ico" type="image/x-icon"/>
    <link rel="bookmark" href="/assets/img/logo.ico" type="image/x-icon"/>
    <script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <link href="/css/tanchukuang.css" rel="stylesheet"/>
</head>
<body class="sb-nav-fixed">
<nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark">
    <a class="navbar-brand ps-3" href="/admin/bookTypeHtml">图书管理系统</a>
    <button class="btn btn-link btn-sm order-1 order-lg-0 me-4 me-lg-0" id="sidebarToggle" href="#!"><i class="fas fa-bars"></i></button>
    <form class="d-none d-md-inline-block form-inline ms-auto me-0 me-md-3 my-2 my-md-0">
        <div class="input-group">
            <input class="form-control" type="text" placeholder="Search for..." aria-label="Search for..." aria-describedby="btnNavbarSearch" />
            <button class="btn btn-primary" id="btnNavbarSearch" type="button"><i class="fas fa-search"></i></button>
        </div>
    </form>
    <ul class="navbar-nav ms-auto ms-md-0 me-3 me-lg-4">
        <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"><i class="fas fa-user fa-fw"></i></a>
            <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
                <li><a class="dropdown-item" href="/admin/goOut">退出登录</a></li>
            </ul>
        </li>
    </ul>
</nav>
<div id="layoutSidenav">
    <div id="layoutSidenav_nav">
        <nav class="sb-sidenav accordion sb-sidenav-dark" id="sidenavAccordion">
            <div class="sb-sidenav-menu">
                <div class="nav">
                    <a class="nav-link" href="/admin/index">
                        <div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
                        图书管理
                    </a>
                    <a class="nav-link" href="/admin/bookTypeHtml">
                        <div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
                        图书类别管理
                    </a>
                    <a class="nav-link collapsed" href="/admin/readerManageHtml" data-bs-toggle="collapse" data-bs-target="#collapseLayouts" aria-expanded="false" aria-controls="collapseLayouts">
                        <div class="sb-nav-link-icon"><i class="fas fa-columns"></i></div>
                        读者管理
                        <div class="sb-sidenav-collapse-arrow"><i class="fas fa-angle-down"></i></div>
                    </a>
                    <div class="collapse" id="collapseLayouts" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordion">
                        <nav class="sb-sidenav-menu-nested nav">
                            <a class="nav-link" href="/admin/readerManageHtml">读者管理</a>
                            <a class="nav-link" href="/admin/cardManageHtml">借阅证管理</a>
                        </nav>
                    </div>
                    <a class="nav-link" href="/admin/borrowManageHtml">
                        <div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
                        当前借阅信息
                    </a>
                    <a class="nav-link" href="/admin/hisborrowHtml">
                        <div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
                        借还信息
                    </a>
                    <a class="nav-link" href="/admin/punishManageHtml">
                        <div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
                        逾期信息
                    </a>
                    <a class="nav-link" href="/admin/updatepassHtml">
                        <div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
                        更改密码
                    </a>
                </div>
            </div>
        </nav>
    </div>
    <div id="layoutSidenav_content">
        <main>
            <div class="container-fluid px-4">
                <h1 class="mt-4">图书类别管理</h1>
                <div class="row">
                    <div class="col-xl-6">
                        <div class="card mb-4">
                            <div class="card-header">
                                <i class="fas fa-chart-area me-1"></i>
                                Area Chart Example
                            </div>
                            <div class="card-body"><canvas id="myAreaChart" width="100%" height="40"></canvas></div>
                        </div>
                    </div>
                    <div class="col-xl-6">
                        <div class="card mb-4">
                            <div class="card-header">
                                <i class="fas fa-chart-bar me-1"></i>
                                Bar Chart Example
                            </div>
                            <div class="card-body"><canvas id="myBarChart" width="100%" height="40"></canvas></div>
                        </div>
                    </div>
                </div>
                <div class="card mb-4">
                    <div class="card-header">
                        <form action="/reader/findBookTypeByInput" method="POST">
                            <input type="text" class="col-form-label-sm" id="bookTypeId" name="typeId" placeholder="typeId">
                            <input type="text" class="col-form-label-sm" id="typeName" name="typeName" placeholder="typeName">
                            <button type="submit" class="btn btn-primary" id="btn-type-query">查询</button>
                        </form>
                    </div>
                </div>
                <div class="card mb-4">
                    <div class="card-header">
                        <i class="fas fa-table me-1"></i>
                        图书列表
                        <a href="/admin/addBookTypeHtml" onclick="displayWindow()"><button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">添加图书类型</button></a>
                        <button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" id="showPopup1" onclick="showPopup1()">修改书籍类型信息</button>
                        <div id="overlay1">
                            <div class="popup">
                                <p class="popup_title">修改书籍类型</p>
                                <div class="card-body">
                                    <form action="/admin/updateBookType" method="post" style="margin-top: 100px">
                                        <div class="row mb-3">
                                            <div class="col-md-6">
                                                <div class="form-floating mb-3 mb-md-0">
                                                    <input class="form-control" id="inputypeId" required type="text" placeholder="typeId" name="typeId" onblur="getInfo()"/>
                                                    <label for="inputypeId">typeId</label>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-floating">
                                                    <input class="form-control" id="inputtypeName" required type="text" placeholder="typeName" name="typeName"/>
                                                    <label for="inputtypeName">typeName</label>
                                                </div>
                                            </div>
                                        </div>
                                        <input type="submit" value="修改" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" onclick="hidePopup1()">
                                        <a href="/admin/index" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" onclick="hidePopup1()">取消</a>
                                    </form>
                                </div>
                            </div>
                        </div>
                        <button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" id="showPopup" onclick="showPopup()">删除书籍类别</button>
                        <div id="overlay">
                            <div class="popup">
                                <p class="popup_title">删除书籍类别</p>
                                <div class="card-body">
                                    <form action="/admin/deleteBookType" method="post">
                                        <div class="row mb-3" style="margin-left: 125px">
                                            <div class="col-md-6" style="margin-left: 25px">
                                                <div class="form-floating mb-3 mb-md-0">
                                                    <input class="form-control" id="inputypeId1" required type="text" placeholder="inputypeId" name="typeId" style="margin-top: 100px"/>
                                                    <label for="inputypeId1">typeId</label>
                                                </div>
                                            </div>
                                        </div>
                                        <input type="submit" value="删除" id="btn-delete" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" onclick="hidePopup()">
                                        <a href="/admin/bookTypeHtml" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" onclick="hidePopup()">取消</a>
                                    </form>
                                </div>
                            </div>
                        </div>

                    </div>
                    <div class="card-body">
                        <table id="datatables">
                            <thead>
                            <tr>
                                <th>typeId</th>
                                <th>typeName</th>
                            </tr>
                            </thead>
                            <tfoot>
                            <tr>
                                <th>typeId</th>
                                <th>typeName</th>
                            </tr>
                            </tfoot>
                            <tbody>
                                <tr th:each="bookType:${bookTypes}">
                                    <td th:text="${bookType.typeId}"></td>
                                    <td th:text="${bookType.typeName}"></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </main>
        <footer class="py-4 bg-light mt-auto">
            <div class="container-fluid px-4">
                <div class="d-flex align-items-center justify-content-between small">
                    <div class="text-muted">Copyright &copy; Your Website 2024</div>
                    <div>
                        <a href="#">隐私政策</a>
                        &middot;
                        <a href="#">条款和条件</a>
                    </div>
                </div>
            </div>
        </footer>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/umd/simple-datatables.min.js" crossorigin="anonymous"></script>
<script src="/js/datatables-demo.js"></script>
<script src="/js/bookTypeList.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<script src="/js/scripts.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js" crossorigin="anonymous"></script>
<script src="/assets/demo/chart-area-demo.js"></script>
<script src="/assets/demo/chart-bar-demo.js"></script>
<script src="/js/tanchukuang.js"></script>
</body>
</html>
